package org.acme.cluster.utils;

import org.jgroups.Address;
import org.jgroups.util.UUID;

import java.util.ArrayList;
import java.util.List;

public class AddressUtils {

    /***
     * 获取所有的uuid
     * @param addresses
     * @return
     */
    public static List<String> getAddresses(List<Address> addresses) {
        List<String> list = new ArrayList<>();
        for (Address address : addresses) {
            if (address!= null && address instanceof UUID){
                list.add(((UUID) address).toStringLong());
            }
        }
        return list;
    }
}
